package com.huige.wiki.service.impl;

import com.huige.wiki.mapper.EbookSnapshotMapper;
import com.huige.wiki.mapper.EbookSnapshotMapperCust;
import com.huige.wiki.resp.StatisticResp;
import com.huige.wiki.service.EbookSnapshotService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class EbookSnapshotServiceImpl implements EbookSnapshotService {

    @Autowired
    EbookSnapshotMapperCust ebookSnapshotMapperCust;
    @Override
    public void genSnapshot() {
        // 生成快照
        ebookSnapshotMapperCust.genSnapshot();
    }

    /**
     * 这两天快照的数值统计
     * @return
     */
    @Override
    public List<StatisticResp> getStatistic() {
        return ebookSnapshotMapperCust.getStatistic();
    }

    /**
     * 近30天的数据统计
     * @return
     */
    @Override
    public List<StatisticResp> get30Statistic() {
        return ebookSnapshotMapperCust.get30Statistic();
    }
}
